using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace tutors_clus.Models.Mapping
{
    public class annoucementMap : EntityTypeConfiguration<annoucement>
    {
        public annoucementMap()
        {
            // Primary Key
            this.HasKey(t => t.id_ann);

            // Properties
            this.Property(t => t.title_ann)
                .HasMaxLength(100);

            this.Property(t => t.file_attach_ann)
                .HasMaxLength(255);

            this.Property(t => t.writer_ann)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("annoucements");
            this.Property(t => t.id_ann).HasColumnName("id_ann");
            this.Property(t => t.title_ann).HasColumnName("title_ann");
            this.Property(t => t.create_date_ann).HasColumnName("create_date_ann");
            this.Property(t => t.file_attach_ann).HasColumnName("file_attach_ann");
            this.Property(t => t.writer_ann).HasColumnName("writer_ann");
            this.Property(t => t.detail_ann).HasColumnName("detail_ann");
            this.Property(t => t.status_ann).HasColumnName("status_ann");
            this.Property(t => t.sort).HasColumnName("sort");
        }
    }
}
